package com.pearadmin.modules.ws;

import com.pearadmin.common.constant.ControllerConstant;

import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping(ControllerConstant.API_APP_PREFIX + "testSend")
public class MessageController {

    /** 广播发送消息，将消息发送到指定的目标地址 */
    @GetMapping("/test/{userId}")
    @ApiOperation("websokect--广播消息")
    public void sendTopicMessage(@PathVariable String userId) {
        WebSocketUtil.send("hello baby",userId);
    }

}